package study.chapter02.innerclass;
//方法内定义内部类
public class Outer4 {
    private String msg = "我是外部类";
    public void print(final String hello){
        //jdk1.8之前的版本要加final，之后的版本可以不加
        //final String aa = "aa";
        class Inner{
            //private String msg = "我是内部类";
            public void innerPrint(){
                System.out.println(msg);
                System.out.println("方法内定义内部类：" + hello);
            }
        }
        new Inner().innerPrint();
    }

    public static void main(String[] args) {
        Outer4 outer = new Outer4();
        outer.print("aaa");
    }
}
